import { FairyGUI } from "csharp";
import ListItem from "../common/ListItem";
/**
 * 
 * @author clong 2020.12.13
 */
export default class UISplitImgItem extends ListItem {

    constructor() {
    
        super();
    }

    initUI():void{

        super.initUI();
    }

    show( data:any ):void{

        super.show( data );

        if( data instanceof FairyGUI.NTexture ){
            console.log("UISplitIImgItem----------->this.displayObject: " + this._iconObject);
            if( this._iconObject instanceof FairyGUI.GLoader ){
                // console.log("UISplitIImgItem----------->this.displayObject: " + this.displayObject + " data: " + data);
                this._iconObject.texture = data;
            }
            this.title = this.name;
        }
    }

    public get texture():FairyGUI.NTexture{

        return this._iconObject.texture;
    }

    hide():void{

        super.hide();

        this.icon = "";
    }
}